using System; 
using System.Collections.Generic; 
using System.Text; 
using FluentNHibernate.Mapping;
using Managistics.Model; 

namespace Managistics.Model.Mappings {
    
    
    public class OrderCustomersMap : ClassMap<OrderCustomers> {
        
        public OrderCustomersMap() {
			Table("ORDER_CUSTOMERS");
			LazyLoad();
			Id(x => x.OrderidC).GeneratedBy.Assigned().Column("ORDERID_C");
			References(x => x.Customers).Column("CUSTOMERID");
			References(x => x.Employees).Column("EMPLOYEEID");
			Map(x => x.Orderdate).Column("ORDERDATE").Not.Nullable();
			Map(x => x.Requestdate).Column("REQUESTDATE").Not.Nullable();
			Map(x => x.ShippingDate).Column("SHIPPING_DATE").Not.Nullable();
			Map(x => x.ShipAddress).Column("SHIP_ADDRESS").Not.Nullable().Length(250);
			Map(x => x.StatusC).Column("STATUS_C");
			Map(x => x.NoteC).Column("NOTE_C").Length(200);
			Map(x => x.PayConditionC).Column("PAY_CONDITION_C").Length(50);
			Map(x => x.CompleteDateCo).Column("COMPLETE_DATE_CO");
			Map(x => x.TypeVat).Column("TYPE_VAT");
			Map(x => x.Confirmnote).Column("ConfirmNote").Length(4000);
			Map(x => x.Contactname).Column("ContactName").Length(4000);
			Map(x => x.Typeorder).Column("TypeOrder");
			Map(x => x.Title).Column("Title").Length(4000);
			Map(x => x.NumOutput).Column("num_output").Not.Nullable().Precision(5);
			Map(x => x.NumReturn).Column("num_return").Not.Nullable().Precision(5);
			HasMany(x => x.DetailOrderCus).KeyColumn("ORDERID");
			HasMany(x => x.OutputSheetTd).KeyColumn("ORDERID");
			HasMany(x => x.ReturnItem).KeyColumn("ORDERID_C");
        }
    }
}
